import { Component, OnInit, ViewChildren } from '@angular/core';

@Component({
  selector: 'app-add-input',
  templateUrl: './add-input.component.html',
  styleUrls: ['./add-input.component.less']
})
export class AddInputComponent implements OnInit {
  @ViewChildren('input') inputElements;
  inputComponents = []
  constructor() { }

  ngOnInit(): void {
  }
  add() {
    console.log("add");
    let newTime = new Date().getTime();
    console.log(newTime);
    this.inputComponents.push(newTime);
  }
  log() {
    console.log(this.inputComponents);
    console.log(this.inputElements);
    this.inputElements.forEach(input => {
      console.log(input.value);
    });
  }
  deleteInput(i) {
    console.log(i);
    this.inputComponents.splice(i, 1);
  }
}
